home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_eyeblock.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  108 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_eyeblock.cog
  4. #    
  5. # Eyeblock vs. Taklit's part
  6. #
  7. # [RKD]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ========================================================================================
  11. symbols
  12. message    startup
  13. message    pulse
  14. message    crossed
  15.  
  16. thing   eyeblock
  17. thing    player    local
  18.  
  19. surface    blockout1    linkid=1
  20. surface    blockout2    linkid=1
  21.  
  22. surface blockback1    linkid=2
  23. surface    blockback2    linkid=2
  24.  
  25. material    bigeye=pyr_a_wall_horus_eye.mat        local
  26.  
  27. int        movedirection=0        local
  28.  
  29. sound    click=nub_anubisarm_place_c.wav        local
  30.  
  31. # subroutines
  32. flex    blockback=0.0    local
  33. flex    blockout=0.0    local
  34. end
  35.  
  36. code
  37. startup:
  38.     SetThingLight(eyeblock, '1 1 .5', .001, .01);
  39.     
  40.     return;
  41.  
  42. crossed:
  43. # ---> all four adjoins
  44.  
  45.     player = GetLocalPlayerThing();
  46.     
  47.     # if leaving area...
  48.     if (GetSenderID() == 2)
  49.     {
  50.         # send block back and turn off pulse
  51.         SetPulse(0);
  52.         call blockback;
  53.     }
  54.     else
  55.     {
  56.         # otherwise start pulse
  57.         SetPulse(.2);
  58.     }
  59.     
  60.     return;
  61.     
  62. blockout:
  63.     # movedirection values:
  64.         # 0: moving into wall or fully in
  65.         # 1: moving out from wall or fully out
  66.     
  67.     # if block is out or on the way, return
  68.     if (movedirection == 1) return;
  69.     
  70.     # open eye, move block out
  71.     movedirection = 1;
  72.     SetMaterialCel(bigeye, 1);
  73.     PlaySoundThing(click, eyeblock, 1, -1, -1, 0);
  74.     
  75.     sleep(.5);
  76.  
  77.     if (moveDirection == 1)
  78.         MoveToFrame(eyeblock, 1, 2.5);
  79.  
  80.     return;
  81.  
  82. blockback:
  83.     # if block is in or on the way, return;
  84.     if (movedirection == 0) return;
  85.  
  86.     # close eye, move block back
  87.     movedirection = 0;
  88.     SetMaterialCel(bigeye, 0);
  89.     PlaySoundThing(click, eyeblock, 1, -1, -1, 0);
  90.  
  91.     MoveToFrame(eyeblock, 0, 2);
  92.  
  93.     return;
  94.  
  95. pulse:
  96.     if (IsInvisible(player))
  97.     {
  98.         call blockback;
  99.     }
  100.     else
  101.     {
  102.         call blockout;
  103.     }
  104.  
  105.     return;
  106.  
  107. end
  108.